
<%@ page import="hc.uco.Paciente" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'paciente.label', default: 'Paciente')}" />
        <title><g:message code="default.show.label" args="[entityName]" /></title>
    </head>
    <body>
        <g:render template="/mainbar" />
        <div class="body">
            <h1>Paciente: ${fieldValue(bean: pacienteInstance, field: "nome")}</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:render template="/pacientebar" />
            <div class="dialog">
                <table>
                    <tbody>
                    	<tr class="prop">
                    		<td valign="middle" class="name">
                    			<g:message code="paciente.hospitalizado.label" default="Hospitalizado" />
                    		</td>
	                    	<td valign="middle" class="name">
	                            <b><g:formatBoolean boolean="${pacienteInstance?.hospitalizado}" true="SIM" false="NAO" /></b>
	                        </td>
	                        <td valign="middle" class="name">
                    			<g:message code="paciente.inclusaoEstudo.label" default="Inclusão no Estudo" />
                    		</td>
	                    	<td valign="middle" class="name">
	                            <b><g:formatBoolean boolean="${pacienteInstance?.inclusaoEstudo}" true="SIM" false="NAO" /></b>
	                        </td>
	                    </tr>
                        <tr class="prop">
                            <td valign="middle" class="name"><g:message code="paciente.nome.label" default="Nome" /></td>
                            <td valign="middle" class="value" colspan="1">${fieldValue(bean: pacienteInstance, field: "nome")}</td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.numeroEstudo.label" default="numeroEstudo" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "numeroEstudo")}</td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.dataInclusao.label" default="Data Inclusao" /></td>
                            <td valign="middle" class="value"><g:formatDate date="${pacienteInstance?.dataInclusao}" format="dd/MM/yyyy" /></td>
                        </tr>
                        
                        <tr class="prop">   
                            <td valign="middle" class="name"><g:message code="paciente.genero.label" default="Genero" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "genero")}</td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.hc.label" default="hc" /></td>
                            <td valign="middle" class="value" colspan="1">${fieldValue(bean: pacienteInstance, field: "hc")}</td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.dataNascimento.label" default="Data Nascimento" /></td>
                            <td valign="middle" class="value" nowrap="nowrap"><g:formatDate date="${pacienteInstance?.dataNascimento}" format="dd/MM/yyyy" />  - ${pacienteInstance?.idade} anos</td>
                        </tr>
                        
                        <tr class="prop">
                            <td valign="middle" class="name"><g:message code="paciente.cpf.label" default="CPF" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "cpf")}</td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.nomeMae.label" default="Nome Mae" /></td>
                            <td valign="middle" class="value" colspan="3">${fieldValue(bean: pacienteInstance, field: "nomeMae")}</td>
                        </tr>
                    
                        <tr class="prop">
                            <td valign="middle" class="name"><g:message code="paciente.primeiroHospital.label" default="Primeiro Hospital" /></td>
                            <td valign="middle" class="value" colspan="1">${fieldValue(bean: pacienteInstance, field: "primeiroHospital")}</td>
                    
                            <td valign="middle" class="name"><g:message code="paciente.transferenciaPara.label" default="Transferencia Para" /></td>
                            <td valign="middle" class="value"><g:formatDate date="${pacienteInstance?.transferenciaPara}" format="dd/MM/yyyy" /></td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.hospitalInternacao.label" default="Hospital Internado" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "hospitalInternacao")}</td>
                        </tr>
                    
                    	<tr class="prop">
                            <td valign="middle" class="name"><g:message code="paciente.profissao.label" default="Profissao" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "profissao")}</td>

                            <td valign="middle" class="name"><g:message code="paciente.escolaridadeAnos.label" default="Escolaridade" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "escolaridadeAnos")} anos</td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.rendaFamiliar.label" default="Renda Familiar" /></td>
                            <td valign="middle" class="value">R$ ${fieldValue(bean: pacienteInstance, field: "rendaFamiliar")}</td>
                        </tr>
                        
                        <tr class="prop">
                            <td valign="middle" class="name"><g:message code="paciente.endereco.label" default="Endereco" /></td>
                            <td valign="middle" class="value" colspan="3">${fieldValue(bean: pacienteInstance, field: "endereco")}</td>

                            <td valign="middle" class="name"><g:message code="paciente.bairro.label" default="Bairro" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "bairro")}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            
                            <td valign="middle" class="name"><g:message code="paciente.cidade.label" default="Cidade" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "cidade")}</td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.estado.label" default="Estado" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "estado")}</td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.cep.label" default="Cep" /></td>
                            <td valign="middle" class="value" colspan="3">${fieldValue(bean: pacienteInstance, field: "cep")}</td>
                            
                        </tr>
                    
                        <tr class="prop">
                            <td valign="middle" class="name"><g:message code="paciente.telefones.label" default="Telefones" /></td>
                            <td valign="middle" class="value" colspan="5">
                               	<table class="transp" cellspacing="0" cellpadding="0">
	                               	<tr>
		                               	<td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "telefone1")}</td>
			                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "telefone2")}</td>
			                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "telefone3")}</td>
			                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "telefone4")}</td>
			                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "telefone5")}</td>
	                                </tr>
                                </table>
                               </td>
                        </tr>
                    
                        <tr class="prop">
                            <td valign="top" class="name"><g:message code="paciente.observacoes.label" default="Observacoes" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "observacoes")}</td>
                        </tr>
                        
                        <tr class="prop">
                    		<td valign="middle" class="name">
                    			<g:message code="paciente.usoAAS.label" default="Uso regular de antiagregante plaquetário nos últimos 7 dias" />
                    		</td>
	                    	<td valign="middle" class="name">
	                            <b><g:formatBoolean boolean="${pacienteInstance?.usoAAS}" true="SIM" false="NAO" /></b>
	                        </td>
	                    </tr>
                        
                        <tr class="prop">
                            <td valign="middle" class="name"><g:message code="paciente.diagnosticoAdmissao.label" default="Diagnóstico de Admissão" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "diagnosticoAdmissao")}</td>
                        </tr>
                    
                    </tbody>
                </table>
                <br>
                <br>
                <h2><g:message code="paciente.apresentacao.titulo" /></h2>
                <table>
                	<tbody>
                        <tr class="prop">
                            <td valign="middle" class="name"><g:message code="paciente.inicioDor.label" default="Inicio Dor" /></td>
                            <td valign="middle" class="value"><g:formatDate date="${pacienteInstance?.inicioDor}" /></td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.chegadaPrimeiroHospital.label" default="Chegada Primeiro Hospital" /></td>
                            <td valign="middle" class="value"><g:formatDate date="${pacienteInstance?.chegadaPrimeiroHospital}" /> - Diferença de tempo: ${pacienteInstance?.deltaT} horas</td>
                            
                            <td valign="middle" class="name"><g:message code="paciente.ecgDiagnostico.label" default="Ecg Diagnostico" /></td>
                            <td valign="middle" class="value"><g:formatDate date="${pacienteInstance?.ecgDiagnostico}" /></td>
                        </tr>
                    
                    	<tr class="prop">
                            <td valign="middle" class="name"><g:message code="paciente.localIAM.label" default="Local IAM" /></td>
                            <td valign="middle" class="value" colspan="5">
                            	<table class="transp"  cellspacing="0" cellpadding="0" width="80%">
                                	<tr>
	                                <td valign="middle">
	                                	<b><g:formatBoolean boolean="${pacienteInstance?.iamAnterior}" true="Anterior" false=" " /></b> 
	                                </td>
	                                <td valign="middle">
	                                	<b><g:formatBoolean boolean="${pacienteInstance?.iamInferior}" true="Inferior" false=" " /></b>
	                                </td>
	                                <td valign="middle">
	                                	<b><g:formatBoolean boolean="${pacienteInstance?.iamDorsal}" true="Dorsal" false=" " /></b>
	                                </td>
	                                <td valign="middle">
	                                	<b><g:formatBoolean boolean="${pacienteInstance?.iamLateral}" true="Lateral" false=" " /></b>
	                                </td>
	                                <td valign="middle">
	                                	<b><g:formatBoolean boolean="${pacienteInstance?.iamVentriculoDireito}" true="Ventriculo Direito" false=" " /></b>
	                                </td>
	                                </tr>
                                </table>
                               </td>
                        </tr>
                        
                        <tr class="prop">
                        	<td valign="middle" class="value" colspan="6">
                               	<table class="transp" cellspacing="0" cellpadding="0" width="100%">
                               	<tr>
                                <td valign="middle" class="name">
                                    <label for="pa"><g:message code="paciente.pa.label" default="Pa" /></label> <b>${fieldValue(bean: pacienteInstance, field: "paS")}/${fieldValue(bean: pacienteInstance, field: "paD")}</b>
                                </td>
                                <td valign="middle" class="name">
                                    <label for="fc"><g:message code="paciente.fc.label" default="Fc" /></label> <b>${fieldValue(bean: pacienteInstance, field: "fc")}</b>
                                </td>
                                <td valign="middle" class="name">
                                    <label for="peso"><g:message code="paciente.peso.label" default="peso" /></label> <b>${fieldValue(bean: pacienteInstance, field: "peso")}</b>
                                </td>
                                <td valign="middle" class="name">
                                    <label for="altura"><g:message code="paciente.altura.label" default="altura" /></label> <b>${fieldValue(bean: pacienteInstance, field: "altura")}</b>
                                </td>
                                <td valign="middle" class="name">
                                    <label for="circAbd"><g:message code="paciente.circAbd.label" default="circAbd" /></label> <b>${fieldValue(bean: pacienteInstance, field: "circAbd")}</b>
                                </td>
                                <td valign="middle" class="name">
                                    <label for="killip"><g:message code="paciente.killip.label" default="Killip" /></label> <b>${fieldValue(bean: pacienteInstance, field: "killip")}</b>
                                </td>
                                </tr>
                                </table>
                             </td>
                        </tr>
                        
                        <tr class="prop">
                    		<td valign="middle" class="name">
                    			<g:message code="paciente.angina24horas.label" default="Angina nas 24 horas que antecedeu o evento" />
                    		</td>
	                    	<td valign="middle" class="name">
	                            <b><g:formatBoolean boolean="${pacienteInstance?.angina24horas}" true="SIM" false="NAO" /></b>
	                        </td>
	                        <td valign="top" class="name"><g:message code="paciente.episodiosAngina24horas.label" default="Nr de episódios" /></td>
                            <td valign="middle" class="value">${fieldValue(bean: pacienteInstance, field: "episodiosAngina24horas")}</td>
	                    </tr>
                    
                    </tbody>
                </table>
                <br>
                <br>
                <table width="100%">
                	<tbody>
                        <tr class="prop">
                            <td valign="middle" class="name">Inserido por</td>
                            <td valign="middle" class="value">
                            	${pacienteInstance?.createdBy?.nome} em <g:formatDate date="${pacienteInstance?.dateCreated}" /></td>
                            
                            <td valign="middle" class="name">Atualizado por</td>
                            <td valign="middle" class="value">
                            	${pacienteInstance?.updatedBy?.nome} em <g:formatDate date="${pacienteInstance?.lastUpdated}" /></td>
                        </tr>
                    </tbody>
               </table>
            </div>
            <br>
            <div class="buttons">
                <g:form>
                    <g:hiddenField name="id" value="${pacienteInstance?.id}" />
                    <g:if test="${session.usuario.admin}">
                    <span class="button"><g:actionSubmit class="edit" action="edit" value="${message(code: 'default.button.edit.label', default: 'Edit')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                	</g:if>
                </g:form>
            </div>
        </div>
    </body>
</html>
